import { handleAsyncRoutes } from "@/router/utils";

const Layout = () => import("@/layout/index.vue");

export const injectInternalRouter = () => {
  handleAsyncRoutes(injectRouters);
};

const injectRouters = [
  {
    menuType: "D",
    icon: "ep:tickets",
    meta: { title: "工作流", icon: "ep:tickets" },
    name: "k8sWorkflow",
    path: "/k8s/workflow",
    component: "Layout",
    children: [
      {
        path: "/k8s/workflow/root",
        name: "k8sWorkflowRoot",
        icon: "ep:tickets",
        meta: { title: "工作流", icon: "ep:tickets" },
        component: "views/domain/kubeHud/views/k8s/workflow/Workflow"
      }
    ]
  },
  {
    path: "/k8s/workload",
    name: "k8sWorkload",
    component: "Layout",
    icon: "ep:cpu",
    meta: { title: "工作负载", icon: "ep:cpu" },
    children: [
      {
        path: "/workload/deployment",
        name: "Deployment",
        icon: "ep:box",
        meta: { title: "Deployment", icon: "ep:box" },
        component: "/views/domain/kubeHud/views/k8s/deployment/Deployment"
      },
      {
        path: "/workload/pod",
        name: "Pod",
        icon: "ep:box",
        meta: { title: "Deployment", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/pod/Pod"
      },
      {
        path: "/workload/daemonset",
        name: "DaemonSet",
        icon: "ep:message-box",
        meta: { title: "DaemonSet", icon: "ep:message-box" },
        component: "views/domain/kubeHud/views/k8s/daemonset/DaemonSet"
      },
      {
        path: "/workload/statefulset",
        name: "StatefulSet",
        icon: "ep:box",
        meta: { title: "StatefulSets", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/statefulset/StatefulSet"
      }
    ]
  },
  {
    path: "/loadbalance",
    name: "负载均衡",
    component: Layout,
    icon: "ep:box",
    meta: { title: "负载均衡", icon: "ep:box" },
    children: [
      {
        path: "/loadbalance/service",
        name: "Service",
        icon: "ep:box",
        meta: { title: "Service", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/service/Service"
      },
      {
        path: "/loadbalance/ingress",
        name: "Ingress",
        icon: "ep:box",
        meta: { title: "Ingress", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/ingress/Ingress"
      }
    ]
  },
  {
    path: "/storage",
    name: "存储与配置",
    component: Layout,
    icon: "ep:box",
    meta: { title: "存储与配置", icon: "ep:box" },
    children: [
      {
        path: "/storage/configmap",
        name: "Configmap",
        icon: "ep:box",
        meta: { title: "Configmap", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/configmap/ConfigMap"
      },
      {
        path: "/storage/secret",
        name: "Secret",
        icon: "ep:box",
        meta: { title: "Secret", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/secret/Secret"
      },
      {
        path: "/storage/persistentvolumeclaim",
        name: "PVC",
        icon: "ep:box",
        meta: { title: "PersistentVolumeClaim", icon: "ep:box" },
        component:
          "views/domain/kubeHud/views/k8s/persistentvolumeclaim/PersistentVolumeClaim"
      }
    ]
  },
  {
    path: "/cluster",
    name: "集群",
    component: Layout,
    icon: "ep:box",
    meta: { title: "集群", icon: "ep:box" },
    children: [
      {
        path: "/cluster/node",
        name: "Node",
        icon: "ep:box",
        meta: { title: "Node", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/node/Node"
      },
      {
        path: "/cluster/namespace",
        name: "Namespace",
        icon: "ep:box",
        meta: { title: "Namespace", icon: "ep:box" },
        component: "views/domain/kubeHud/views/k8s/namespace/Namespace"
      },
      {
        path: "/cluster/persistentvolume",
        name: "PersistentVolume",
        icon: "ep:box",
        meta: { title: "PersistemtVolume", icon: "ep:box" },
        component:
          "views/domain/kubeHud/views/k8s/persistentvolume/PersistentVolume"
      }
    ]
  }
];
